projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e39e811
)
* fns.c (concat): Catch string overflow earlier.
author
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 18 Jun 2011 15:08:31 +0000
(08:08 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 18 Jun 2011 15:08:31 +0000
(08:08 -0700)
Do not rely on integer wraparound.
src/ChangeLog
patch
|
blob
|
history
src/fns.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index 79d9b636e09f5d280b0390867a7a18e35f3170fe..b9cf18cedd945862939dc5fe05620db40b6c32b2 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,5
+1,8
@@
2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
+ * fns.c (concat): Catch string overflow earlier.
+ Do not rely on integer wraparound.
+
* dispextern.h (struct it.overlay_strings_charpos): EMACS_INT, not int.
2011-06-17 Paul Eggert <eggert@cs.ucla.edu>
diff --git
a/src/fns.c
b/src/fns.c
index a19c886e3e1f0ef002db37d7337e6c8c748fcf68..4c1505ab0f12b94cad973b80778d8a56c88fa8bc 100644
(file)
--- a/
src/fns.c
+++ b/
src/fns.c
@@
-565,8
+565,8
@@
concat (ptrdiff_t nargs, Lisp_Object *args,
}
result_len += len;
- if (
result_len < 0
)
-
error ("String overflow"
);
+ if (
STRING_BYTES_BOUND < result_len
)
+
string_overflow (
);
}
if (! some_multibyte)